<!doctype html>
<html lang="en"><head>
    <meta charset="utf-8">
    <title>后台管理</title>
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <!--link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'-->
    <link rel="stylesheet" type="text/css" href="<?php echo VIEW.'admin/'?>lib/bootstrap/css/bootstrap.css">
    <link rel="stylesheet" href="<?php echo VIEW.'admin/'?>lib/font-awesome/css/font-awesome.css">

    <script src="<?php echo VIEW.'admin/'?>lib/jquery-1.11.1.min.js" type="text/javascript"></script>

        <script src="<?php echo VIEW.'admin/'?>lib/jQuery-Knob/js/jquery.knob.js" type="text/javascript"></script>

    <link rel="stylesheet" type="text/css" href="<?php echo VIEW.'admin/'?>stylesheets/theme.css">
    <link rel="stylesheet" type="text/css" href="<?php echo VIEW.'admin/'?>stylesheets/premium.css">

</head>
<body class="theme-blue">

    <!-- header white -->
    <style type="text/css">
        #line-chart {
            height:300px;
            width:800px;
            margin: 0px auto;
            margin-top: 1em;
        }
        .navbar-default .navbar-brand, .navbar-default .navbar-brand:hover {
            color: #fff;
        }
    </style>

    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

    <!-- Le fav and touch icons -->
    <link rel="shortcut icon" href="../assets/ico/favicon.ico">
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="../assets/ico/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="../assets/ico/apple-touch-icon-114-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="../assets/ico/apple-touch-icon-72-precomposed.png">
    <link rel="apple-touch-icon-precomposed" href="../assets/ico/apple-touch-icon-57-precomposed.png">
  

  <!--[if lt IE 7 ]> <body class="ie ie6"> <![endif]-->
  <!--[if IE 7 ]> <body class="ie ie7 "> <![endif]-->
  <!--[if IE 8 ]> <body class="ie ie8 "> <![endif]-->
  <!--[if IE 9 ]> <body class="ie ie9 "> <![endif]-->
  <!--[if (gt IE 9)|!(IE)]><!--> 
   
  <!--<![endif]-->

    <div class="navbar navbar-default" role="navigation">
        <div class="navbar-header">
            <a class="navbar-brand" href="<?php echo SITE_URL.'index.php/admin';?>">后台管理</a>
        </div>

        <div class="navbar-collapse collapse" style="height: 1px;">
            <ul id="main-menu" class="nav navbar-nav navbar-right">
                <li class="dropdown hidden-xs">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                    <span class="glyphicon glyphicon-user padding-right-small" style="position:relative;top: 3px;"></span><?=$username?><i class="fa fa-caret-down"></i>
                    </a>

                <ul class="dropdown-menu">
                    <li><a href="#">我的信息</a></li>
                    <li class="divider"></li>
                    <li class="dropdown-header">管理界面</li>
                    <li><a href="<?php echo SITE_URL.'index.php/admin/logout';?>">退出</a></li>
                </ul>
                </li>
            </ul>

        </div>
    </div>
    

    <div class="sidebar-nav">
    <ul>
        <li><a href="#" data-target=".dashboard-menu" class="nav-header" data-toggle="collapse"><i class="fa fa-fw fa-dashboard"></i> 仪表盘<i class="fa fa-collapse"></i></a>
        </li>
        <li><ul class="dashboard-menu nav nav-list collapse in">
            <li><a href="<?php echo SITE_URL.'index.php/admin';?>"><span class="fa fa-caret-right"></span> 主界面</a></li>
            <li ><a href="<?php echo SITE_URL.'index.php/article/editor';?>"><span class="fa fa-caret-right"></span> 写文章</a></li>
            <li ><a href="<?php echo SITE_URL.'index.php/article/lists';?>"><span class="fa fa-caret-right"></span>文章列表</a></li>
            <!-- 暂时不用 -->
            <!--li ><a href="#"><span class="fa fa-caret-right"></span> 用户列表</a></li>
            <li ><a href="#"><span class="fa fa-caret-right"></span> 用户信息</a></li>
            <li ><a href="#"><span class="fa fa-caret-right"></span> 媒体</a></li-->
        </ul></li>

            <li data-popover="true" rel="popover" data-placement="right"><a href="#" data-target=".premium-menu" class="nav-header collapsed" data-toggle="collapse"><i class="fa fa-fw fa-fighter-jet"></i> 高级功能<i class="fa fa-collapse"></i></a></li>
            <!--li><ul class="premium-menu nav nav-list collapse">
                <li ><a href="#"><span class="fa fa-caret-right"></span> 升级用户</a></li>
                <li ><a href="#"><span class="fa fa-caret-right"></span> 插件</a></li>
                <li ><a href="#"><span class="fa fa-caret-right"></span> 更新时间列表</a></li>
                <li ><a href="#"><span class="fa fa-caret-right"></span> 媒体列表</a></li>
                <li ><a href="#"><span class="fa fa-caret-right"></span> 更多工具</a></li>
            </ul></li!-->

        <li><a href="#" data-target=".accounts-menu" class="nav-header collapsed" data-toggle="collapse"><i class="fa fa-fw fa-briefcase"></i>账户</a></li>
        <li><ul class="accounts-menu nav nav-list collapse">
            <li ><a href="<?php echo SITE_URL.'index.php/admin/accountinfo';?>"><span class="fa fa-caret-right"></span>账户信息</a></li>
            <li ><a href="<?php echo SITE_URL.'index.php/admin/logout';?>"><span class="fa fa-caret-right"></span>退出</a></li>
        </ul></li>

        <li><a href="#" data-target=".legal-menu" class="nav-header collapsed" data-toggle="collapse"><i class="fa fa-fw fa-legal"></i>法律信息<i class="fa fa-collapse"></i></a></li>
        <li><ul class="legal-menu nav nav-list collapse">
            <li ><a href="#"><span class="fa fa-caret-right"></span> 隐私权政策</a></li>
            <li ><a href="#"><span class="fa fa-caret-right"></span> 条款与条件</a></li>
        </ul></li>

        <li><a href="#" class="nav-header"><i class="fa fa-fw fa-question-circle"></i>帮助</a></li>
        <li><a href="#" class="nav-header"><i class="fa fa-fw fa-comment"></i>问与答</a></li>
    </ul>
    </div>

    <div class="content">
        <div class="header">
            <div class="stats">
    <!--p class="stat"><span class="label label-info">5</span> 通知</p>
    <p class="stat"><span class="label label-success">27</span> 任务</p>
    <p class="stat"><span class="label label-danger">15</span> 过期</p-->
</div>

            <h1 class="page-title">仪表盘</h1>
                    <ul class="breadcrumb">
            <li><a href="<?php echo SITE_URL.'index.php/admin';?>">管理主页</a> </li>
            <li class="active">仪表盘</li>
        </ul>

        </div>
        <div class="main-content">

    <div class="panel panel-default">
        <a href="#page-stats" class="panel-heading" data-toggle="collapse">数据统计</a>
        <div id="page-stats" class="panel-collapse panel-body collapse in">
            <div class="row">
                <div class="col-md-1">
                    浏览次数统计
                </div>
                <div class="widget col-md-9 col-md-offset-1">

                <div class="widget-content">
                    <script src="<?php echo VIEW; ?>Chart.js"></script>
                    <div class="row">
                        <div class="span4">
                            <canvas id="myChart"></canvas>
                        </div>
                    </div>
                    <script>
                        var data = {
                            labels : ["首页浏览次数","文章浏览总次数"<?php
                                    for($i=0;$i<count($views);$i++)
                                    {
                                        echo ",\"".$viewname[$i]."\"";
                                    }
                                    ?>],
                            datasets : [
                                {
                                    fillColor : "rgba(151,187,205,0.5)",
                                    strokeColor : "rgba(151,187,205,1)",
                                    data : [<?=$indexviews?>,<?=$allviews?><?php
                                                for($i=0;$i<count($views);$i++)
                                                {
                                                    echo ",".$views[$i]->views;
                                                }
                                            ?>]
                                }
                            ]
                        }


                    </script>
                </div> <!-- /widget-content -->
            </div>
            </div><!--  row -->
            <div class="row">
                <div class="col-md-1">
                    文章总数统计
                </div>
                <div class="widget col-md-9 col-md-offset-1">

                    <div class="widget-content">

                        <div class="row">
                            <div class="span4">
                                <canvas id="myChart1"></canvas>
                            </div>
                        </div>
                        <script>
                            var data1 = {
                                labels : [<?php
                                for($i=0;$i<count($blogs);$i++)
                                {
                                    if($i == 0)
                                    {
                                        echo "\"".$sortname[$i]."\"";
                                    }
                                    else
                                    {
                                        echo ",\"".$sortname[$i]."\"";
                                    }
                                }
                            ?>],
                            datasets : [
                                {
                                    fillColor : "rgba(151,187,205,0.5)",
                                    strokeColor : "rgba(151,187,205,1)",
                                    data : [<?php
                            for($i=0;$i<count($blogs);$i++)
                            {
                                if($i == 0)
                                {
                                    echo $blogs[$i]->nums;
                                }
                                else
                                {
                                    echo ",".$blogs[$i]->nums;
                                }

                            }
                            ?>]
                            }
                            ]
                            }

                            window.onload = function(){
                                //Get context with jQuery - using jQuery's .get() method.
                                var ctx = $("#myChart").get(0).getContext("2d");
                                //This will get the first returned node in the jQuery collection.
                                var myNewChart = new Chart(ctx);
                                //var ctx = document.getElementById("chart-area").getContext("2d");
                                //window.myPie = new Chart(ctx).Bar(data,options);
                                new Chart(ctx).Bar(data,{responsive: true});

                                //Get context with jQuery - using jQuery's .get() method.
                                var ctxx = $("#myChart1").get(0).getContext("2d");
                                //This will get the first returned node in the jQuery collection.
                                var myNewChart = new Chart(ctx);
                                //var ctx = document.getElementById("chart-area").getContext("2d");
                                //window.myPie = new Chart(ctx).Bar(data,options);
                                new Chart(ctxx).Bar(data1,{responsive: true});
                            };
                        </script>



                    </div> <!-- /widget-content -->
                </div>
            </div>
        </div>
    </div>

<!--div class="row">
    <div class="col-sm-6 col-md-6">
        <div class="panel panel-default">
            <div class="panel-heading no-collapse">不可折叠<span class="label label-warning">+10</span></div>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
        </div>
    </div>
    <div class="col-sm-6 col-md-6">
        <div class="panel panel-default">
            <a href="#widget1container" class="panel-heading" data-toggle="collapse">分类文章饼状图 </a>
            <div id="widget1container" class="panel-collapse panel-body collapse in">
            <div class="row">

                </div>
        </div>
    </div>
</div>



        </div-->
        <footer>
            <hr>

            <!-- Purchase a site license to remove this link from the footer: http://www.portnine.com/bootstrap-themes -->
            <p class="pull-right">YZ Studio</a></p>
            <p>© <?= date('Y') ?> <a href="#" target="_blank">规划处</a></p>
        </footer>
    </div>


    <script src="<?php echo VIEW.'admin/'?>lib/bootstrap/js/bootstrap.js"></script>
    
  
</body></html>
